package top.jle.wx.proxy.domain.templateMsg;

import io.swagger.v3.oas.annotations.media.Schema;
import lombok.Getter;
import lombok.Setter;
import org.apache.commons.lang3.StringUtils;

@Schema(title="推送到小程序的模板消息请求体")
@Getter
@Setter
public class MiniprogramMessageOption extends TemplateMessage {
    @Schema(title="小程序页面路径",description = "可以带参数")
    private String page;
    @Schema(title="小程序客户端产生的form_id",description = "可以通过表单生成或支付生成,详见<a href='https://developers.weixin.qq.com/miniprogram/dev/api/sendTemplateMessage.html'>官方文档</a>")
    private String from_id;
    @Schema(title="需要放大的关键词",description = "格式详见<a href='https://developers.weixin.qq.com/miniprogram/dev/api/sendTemplateMessage.html'>官方文档</a>")
    private String emphasis_keyword;

    @Override
    public boolean valid() {
        return super.valid() && StringUtils.isNotBlank(this.page) && StringUtils.isNotBlank(this.from_id);
    }
}
